<%page args="note, read_only=False" />
<li id="note_${note.id}" 
    class="note" 
    onmouseover="show_inline('remove_note_link_${note.id}');show_inline('edit_note_link_${note.id}')" 
    onmouseout="hide('remove_note_link_${note.id}'); hide('edit_note_link_${note.id}');">
	<div class="note_content" id="note_content_${note.id}">
		<div>${note.note}</div>
        % if note.last_edited:
        <p><i>Last edited: ${note.last_edited.strftime('%d.%m.%Y %I:%M %p')}</i></div>
        % endif
		<br/>
		<div class="note_info">
			<span>
			Posted by ${h.mail_to(note.creator.email, note.creator.username, class_='note_creator')}
			on ${note.created.strftime('%d.%m.%Y %I:%M %p')}
			</span>
			% if note.creator==c.current_user or h.in_group('admin'):
			${h.link_to_function('edit', "request_note_content(%s);" % note.id, class_='edit_note_link', id='edit_note_link_%s' % note.id)}
			${h.link_to_function('remove', "remove_note(%s);" % note.id, class_='remove_note_link', id='remove_note_link_%s' % note.id)}
			% endif
		</div>
	</div>
	% if not read_only:
    <div class="note_content" id+"edit_note_${note.id}" style="display:none">
    ${h.text_area('content', note.note, 
                  style="display: block; width: 540px; height: 275px;",
                  id="ta_edit_note_%s"  % note.id, 
                  rows=16, 
                  cols=74)}
    ${h.link_to_function('save', "edit_note(%s)" % note.id)}
    ${h.link_to_function('cancel', "cancel_edit(%s)" % note.id)}
	% endif 
</li>
